function showToast(title: string) {
  const opts = {
    title,
    icon: 'none' as const,
    duration: 2000,
  };
  uni.showToast(opts);
}

function successToast(title: string) {
  const opts = {
    title,
    icon: 'success' as const,
  };
  uni.showToast(opts);
}

function errorToast(title: string) {
  const opts = {
    title,
    icon: 'error' as const,
    duration: 2000,
  };
  uni.showToast(opts);
}

function showLoading(title = '') {
  const opts = {
    title,
    mask: true,
  };
  uni.showLoading(opts);
}

export { showToast, successToast, errorToast, showLoading };
